import { fromJS } from 'immutable'
import * as types from './action-types'

const defaultState = fromJS({
  navTabs: [
    {
      path: '/home/account',
      title: '账户管理',
      icon: '&#xe632;'
    }, {
      path: '/home/money/month',
      title: '收银管理',
      icon: '&#xe67b;'
    }, {
      path: '/home/shop',
      title: '查询系统',
      icon: '&#xe614;'
    }, {
      path: '/home/member',
      title: '会员中心',
      icon: '&#xe602;'
    }, {
      path: '/home/service',
      title: '服务中心',
      icon: '&#xe69b;'
    }, {
      path: '/home/person',
      title: '人力中心',
      icon: '&#xe604;'
    }, {
      path: '/home/report',
      title: '经营报表',
      icon: '&#xe660;'
    }
  ],
  activeRouter: '/home/account'
})

export default (state = defaultState, action) => {
  switch (action.type) {
    case types['CHANGE_ACTIVE_ROUTER']:
      return state.set('activeRouter', action.path)
    default:
      return state
  }
}
